package metier;
import java.util.List;


import org.hibernate.Session;
import org.hibernate.Transaction;
import dao.DocenteteDAO;
import dao.DocligneDAO;
import persistence.BaseDAO;


public class DocligneManager {
	

	public static List getDocentetes(int idDocentete,int start, int limit) throws Exception {
		Session session = BaseDAO.getInstance().openSession();
		Transaction tx = null;
		try {
			tx = session.beginTransaction();
			List list  = DocligneDAO.getListDocligne("from Docligne dl where dl.idDocentete="+idDocentete,session,start,limit);
			session.close();
			return list;
		}catch (Exception e) {
			if (tx != null) {
				tx.rollback();
			}
			e.printStackTrace();			
			throw new Exception(e.getMessage());
		}
	}
}